package com.jason.demo.two

import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.jason.demo.two.model.MainItem
import com.jason.library.common.base.BaseActivity

class MainActivity : BaseActivity() {

    private lateinit var recyclerView: RecyclerView
    private lateinit var adapter: MainAdapter
    private val datas = mutableListOf<MainItem>()

    override fun beforeViewInit() {

    }

    override fun getLayoutId() = R.layout.activity_main

    override fun initView() {
        recyclerView = findViewById(R.id.recyclerView)
        recyclerView.layoutManager =
            LinearLayoutManager(this@MainActivity, LinearLayoutManager.VERTICAL, false)
        adapter = MainAdapter()
        recyclerView.adapter = adapter
    }

    override fun onDataInit() {
        datas.add(MainItem("Simple DataBinding", SimpleActivity::class.java))
        adapter.setList(datas)
    }
}